<!-- 
   图文结构封装组件
  -->
<template>
  <div>
    <el-table :data="tableData" style="width: 100%" size="mini" border>
      <el-table-column type="index" width="50" label="序号" align="center">
      </el-table-column>
      <el-table-column
        label="费用种类"
        prop="feeType"
        align="center"
        width="220px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.feeType"
              size="mini"
              maxlength="50"
              width="200px;"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="应缴金额(元)"
        prop="feeAmount"
        align="center"
        width="100px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.feeAmount"
              style="width:80px;"
              size="mini"
              maxlength="8"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="缴费截止日"
        prop="expiryDate"
        align="center"
        width="150px;"
      >
        <template slot-scope="scope">
          <div>
            <el-date-picker
              v-model="scope.row.expiryDate"
              style="width:130px;"
              size="mini"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
              :disabled="scope.row.status != '0'"
            ></el-date-picker>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="应交滞纳金额(元)"
        prop="overdueAmount"
        align="center"
        width="100px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.overdueAmount"
              style="width:80px;"
              size="mini"
              maxlength="8"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="代理费金额(元)"
        prop="agentAmount"
        align="center"
        width="100px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.agentAmount"
              style="width:80px;"
              size="mini"
              maxlength="8"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="其他费用金额(元)"
        prop="otherAmount"
        align="center"
        width="100px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.otherAmount"
              style="width:80px;"
              size="mini"
              maxlength="50"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="说明"
        prop="remark"
        align="center"
        show-word-limit
      >
        <template slot-scope="scope">
          <div>
            <el-input
              type="textarea"
              v-model="scope.row.remark"
              maxlength="500"
              show-word-limit
              resize="none"
              :autosize="{ minRows: 1 }"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <!-- <el-table-column
        label="缴费人姓名"
        prop="payName"
        align="center"
        width="140px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.payName"
              style="width:120px;"
              size="mini"
              maxlength="50"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="票据代码"
        prop="billCode"
        align="center"
        width="140px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.billCode"
              style="width:120px;"
              size="mini"
              maxlength="50"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="票据号码（收据号）"
        prop="billNumber"
        align="center"
        width="140px;"
      >
        <template slot-scope="scope">
          <div>
            <el-input
              v-model="scope.row.billNumber"
              style="width:120px;"
              size="mini"
              maxlength="50"
              :disabled="scope.row.status != '0'"
            ></el-input>
          </div>
        </template>
      </el-table-column> -->
      <el-table-column label="操作" align="center" width="80px;">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="danger"
            plain
            style="margin: 5px"
            @click="del(scope.$index)"
            v-if="scope.row.status == '0'"
          >
            删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="add-text">
      <span @click="addLine"><i class="el-icon-plus"></i>点击添加</span>
    </div>
  </div>
</template>
<script>
export default {
  name: "feeText",
  props: ["tableData", "patentManageId"],
  data() {
    return {
      url: process.env.VUE_APP_URL + "/sys/oss/upload",
      // url: "https://jsonplaceholder.typicode.com/posts/"
      hideUpload: false,
      imgIndex: 0
    };
  },
  components: {},
  mounted() {},
  methods: {
    del(value) {
      this.tableData.splice(value, 1);
      this.$emit("handleTableDate", this.tableData);
    },
    addLine() {
      //添加行数
      var newValue = {
        id: "",
        patentManageId: this.patentManageId,
        feeType: "",
        feeAmount: 0,
        expiryDate: "",
        overdueAmount: 0,
        payName: "",
        billCode: "",
        billNumber: "",
        agentAmount: 0,
        otherAmount: 0,
        remark: "支付接口手续费0.6%",
        //payTime: "",
        status: "0",
        rpa_status: "0"
      };
      //添加新的行数
      this.tableData.push(newValue);
      this.$emit("handleTableDate", this.tableData);
    }
  }
};
</script>
<style scoped lang="scss">
.sort {
  cursor: pointer;
  color: #409eff;
}
.sort:hover {
  color: #027cfb;
}
.add-text {
  text-align: center;
  span {
    cursor: pointer;
    color: #027cfb;
  }
}
</style>
